Skip to content

refactor: add GET /api/v1/devices/export endpoint - #1209

Open
ShradhaGupta31 wants to merge 4 commits into
mainfrom
device-discovery-exportAPI
Open

refactor: add GET /api/v1/devices/export endpoint#1209
ShradhaGupta31 wants to merge 4 commits into
mainfrom
device-discovery-exportAPI

Conversation

@ShradhaGupta31

@ShradhaGupta31 ShradhaGupta31 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Addresses: #1076

ADR: https://github.com/device-management-toolkit/console/wiki/ADR-devices-export-api

  • flat->nested mapping done in one place so SQL and Mongo responses match
  • me/os/platform/bmc render as null when a subsystem has no data
  • X-Total-Count header and server-side audit log per export attempt
  • fields with no writer yet are marked export-map and render null

@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.85714% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.20%. Comparing base (c9ec0a5) to head (a897fbf).

Files with missing lines Patch % Lines
internal/controller/httpapi/v1/export.go 97.95% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1209      +/-   ##
==========================================
+ Coverage   56.71%   58.20%   +1.49%     
==========================================
  Files         149      150       +1     
  Lines       12154    12329     +175     
==========================================
+ Hits         6893     7176     +283     
+ Misses       5260     5152     -108     
  Partials        1        1              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread internal/controller/httpapi/v1/export.go Outdated
Comment thread internal/controller/httpapi/v1/export.go
Comment thread internal/controller/httpapi/v1/export.go Outdated
Comment thread internal/controller/httpapi/v1/devices.go
Comment thread internal/controller/httpapi/v1/export.go Outdated
Comment thread internal/controller/httpapi/v1/export.go Outdated
@ShradhaGupta31
ShradhaGupta31 marked this pull request as ready for review September 8, 2026 07:46
@ShradhaGupta31
ShradhaGupta31 requested a review from a team as a code owner September 8, 2026 07:46
- flat->nested mapping done in one place so SQL and Mongo responses match
- me/os/platform/bmc render as null when a subsystem has no data
- X-Total-Count header and server-side audit log per export attempt
- fields with no writer yet are marked export-map and render null

Add the Fuego/OpenAPI declaration and a Postman request asserting the
envelope shape, X-Total-Count, and absence of credential fields.

Signed-off-by: ShradhaGupta31 <shradha.gupta@intel.com>
- addressed review comments

Signed-off-by: ShradhaGupta31 <shradha.gupta@intel.com>
- updated internal/controller/httpapi/v1/devices_test.go

Signed-off-by: ShradhaGupta31 <shradha.gupta@intel.com>
Revert the route rename to /api/v1/device-exports. The separate-resource
guidance was about the future async job design, not this PR; for now the
endpoint stays under /devices since only up to 500 devices are supported
synchronously.

Signed-off-by: ShradhaGupta31 <shradha.gupta@intel.com>
@sinchubhat
sinchubhat force-pushed the device-discovery-exportAPI branch from cafe7f8 to a897fbf Compare September 9, 2026 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants